-
Notifications
You must be signed in to change notification settings - Fork 131
refactor: replaces picocolors
with node:util's styleText
#346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 1569bc4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
picocolors
with node:util's
styleText
picocolors
with node:util's
styleText
picocolors
with node:util's styleText
@example/basic • @example/changesets
commit: |
@@ -41,38 +41,41 @@ export const groupMultiselect = <Value>(opts: GroupMultiSelectOptions<Value>) => | |||
const isLast = isItem && (next as any).group === true; | |||
const prefix = isItem ? (selectableGroups ? `${isLast ? S_BAR_END : S_BAR} ` : ' ') : ''; | |||
const spacingPrefix = | |||
groupSpacing > 0 && !isItem ? `\n${color.cyan(S_BAR)} `.repeat(groupSpacing) : ''; | |||
// groupSpacing > 0 && !isItem ? `\n${color.cyan(S_BAR)} `.repeat(groupSpacing) : ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this left over? and should be removed
) | ||
.join('\n'); | ||
output.write( | ||
`${color.gray(S_BAR)}\n${color.green(S_STEP_SUBMIT)} ${color.reset(title)} ${color.gray( | ||
`${styleText('gray', S_BAR)}\n${styleText('green', S_STEP_SUBMIT)} ${styleText('reset', title || '')} ${styleText( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when is title nullish? i.e. why did we end up with ||
?
@@ -15,23 +15,25 @@ export const password = (opts: PasswordOptions) => { | |||
input: opts.input, | |||
output: opts.output, | |||
render() { | |||
const title = `${color.gray(S_BAR)}\n${symbol(this.state)} ${opts.message}\n`; | |||
// const title = `${color.gray(S_BAR)}\n${symbol(this.state)} ${opts.message}\n`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe remove this comment too?
@@ -115,7 +115,8 @@ export const spinner = ({ | |||
unblock = block({ output }); | |||
_message = removeTrailingDots(msg); | |||
_origin = performance.now(); | |||
output.write(`${color.gray(S_BAR)}\n`); | |||
// output.write(`${color.gray(S_BAR)}\n`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another comment we can probably remove
@@ -12,7 +12,7 @@ exports[`autocomplete > can be aborted by a signal 1`] = ` | |||
[36m│[39m [2m○[22m [2mCherry[22m | |||
[36m│[39m [2m○[22m [2mGrape[22m | |||
[36m│[39m [2m○[22m [2mOrange[22m | |||
[36m│[39m [2m[2m↑/↓[22m[2m to select • [2mEnter:[22m[2m confirm • [2mType:[22m[2m to search[22m | |||
[36m│[39m [2m[2m↑/↓[22m to select • [2mEnter:[22m confirm • [2mType:[22m to search[22m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this shows that styleText
doesn't handle nested colours. e.g.:
styleText(`i am dim ${styleText('bold', 'i am bold')} i am no longer dim`);
we should search our code for any nested styles and double check they actually work
Closes: #338